package com.azxc.rapid.plus.user.service.impl;


import com.azxc.rapid.core.mp.base.BaseServiceImpl;
import com.azxc.rapid.core.secure.utils.AuthUtil;
import com.azxc.rapid.plus.user.mapper.CommonUserMapper;
import com.azxc.rapid.plus.user.service.ICommonUserService;
import com.azxc.rapid.system.user.entity.User;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;

/**
 * 服务实现类
 * @author 91311
 */
@Service
public class CommonUserServiceImpl extends BaseServiceImpl<CommonUserMapper, User> implements ICommonUserService {
	@Override
	public IPage<User> selectUserPage(IPage<User> page, User user, Long deptId, String tenantId) {
		if(deptId == null){
			if(!AuthUtil.isAdministrator()){
				deptId = Long.valueOf(AuthUtil.getDeptId());
			}
		}
		return page.setRecords(baseMapper.selectUserPage(page, user, deptId, tenantId));
	}
}
